function initPage(baseInfoJson,antibacterialDrugInfoJson){
	var basePath = $("#basePath").val();
	
	
	
	$("select").each(function(){
		$(this).append("<option value=''>---请选择---</option>");
	});
	var pathogens = baseInfoJson['pathogens'];//病原体
	$(".pathogenSelect").each(function(){
		var options = "";
		for(var index in pathogens){
			var pathogen = pathogens[index];
	    	options+="<option value='"+pathogen.uniq_code+"'>"+pathogen.label+"</option>"
	    } 
       $(this).append(options);
	});
	
	var pathogenyCheckSpecimens = baseInfoJson['pathogenyCheckSpecimens'];//病原学检测标本
	$(".pathogenyCheckSpecimenSelect").each(function(){
		var options = "";
		for(var index in pathogenyCheckSpecimens){
			var pathogenyCheckSpecimen = pathogenyCheckSpecimens[index];
	    	options+="<option value='"+pathogenyCheckSpecimen.uniq_code+"'>"+pathogenyCheckSpecimen.label+"</option>"
	    } 
       $(this).append(options);
	});
	

	
	var antibacterialDrugPurposes = baseInfoJson['antibacterialDrugPurposes'];//抗菌用药目的
	$(".antibacterialDrugPurposeSelect").each(function(){
		var options = "";
		for(var index in antibacterialDrugPurposes){
			var antibacterialDrugPurpose = antibacterialDrugPurposes[index];
	    	options+="<option value='"+antibacterialDrugPurpose.uniq_code+"'>"+antibacterialDrugPurpose.label+"</option>"
	    } 
       $(this).append(options);
	});
	
	var antibacterialDrugRegimens = baseInfoJson['antibacterialDrugRegimens'];//抗菌用药方案
	$(".antibacterialDrugRegimenSelect").each(function(){
		var options = "";
		for(var index in antibacterialDrugRegimens){
			var antibacterialDrugRegimen = antibacterialDrugRegimens[index];
	    	options+="<option value='"+antibacterialDrugRegimen.uniq_code+"'>"+antibacterialDrugRegimen.label+"</option>"
	    } 
       $(this).append(options);
	});
	
	var antibacterialDrugClassificatorys = baseInfoJson['antibacterialDrugClassificatorys'];//抗菌用药方案
	$(".antibacterialDrugClassificatorySelect").each(function(){
		var options = "";
		for(var index in antibacterialDrugClassificatorys){
			var antibacterialDrugClassificatory = antibacterialDrugClassificatorys[index];
	    	options+="<option value='"+antibacterialDrugClassificatory.uniq_code+"'>"+antibacterialDrugClassificatory.label+"</option>"
	    } 
       $(this).append(options);
	});
	
	var antibacterialDrugRecords = antibacterialDrugInfoJson['antibacterialDrugRecords'];//过敏药物记录明细集合
	for(var index in antibacterialDrugRecords){
		var antibacterialDrugRecord = antibacterialDrugRecords[index];
		var add_content= addAntibacterialDrugRecord();
		add_content.find("input[name$='.drugStartDateTime']").val(antibacterialDrugRecord.drugStartDateTime);
		add_content.find("input[name$='.drugEndDateTime']").val(antibacterialDrugRecord.drugEndDateTime);
		add_content.find("input[name$='.drugConsumption']").val(antibacterialDrugRecord.drugConsumption);
		
		if(antibacterialDrugRecord.hemorrhageAddDrug1Code){
			
			add_content.find("input[name$='.hemorrhageAddDrug1Code'][value='"+antibacterialDrugRecord.hemorrhageAddDrug1Code+"']").attr("checked",true);
			
		}
		add_content.find("input[name$='.hemorrhageAddDrug1Name']").val(antibacterialDrugRecord.hemorrhageAddDrug1Name);
		
		if(antibacterialDrugRecord.operateAddDrug1Code){
			
			add_content.find("input[name$='.operateAddDrug1Code'][value='"+antibacterialDrugRecord.operateAddDrug1Code+"']").attr("checked",true);
			
		}
		add_content.find("input[name$='.operateAddDrug1Name']").val(antibacterialDrugRecord.operateAddDrug1Name);
		
		
		if(antibacterialDrugRecord.iatrogenicCheckCode){
			
			add_content.find("input[name$='.iatrogenicCheckCode'][value='"+antibacterialDrugRecord.iatrogenicCheckCode+"']").attr("checked",true);
			
		}
		add_content.find("input[name$='.iatrogenicCheckName']").val(antibacterialDrugRecord.iatrogenicCheckName);
		
		
		if(antibacterialDrugRecord.antibacterialDrugPurposeCode){
			var selectOption = add_content.find("select[name$='antibacterialDrugPurposeCode']").find("option[value='"+antibacterialDrugRecord.antibacterialDrugPurposeCode+"']")
			if(selectOption.length > 0){
				selectOption.attr("selected",true);
			}else{
				add_content.find("select[name$='antibacterialDrugPurposeCode']").append("<option selected='selected' value='"+antibacterialDrugRecord.antibacterialDrugPurposeCode+"'>"+antibacterialDrugRecord.antibacterialDrugPurposeName+"</option>");
			}
			
		};
		add_content.find("input[name$='.antibacterialDrugPurposeName']").val(antibacterialDrugRecord.antibacterialDrugPurposeName);
		
		
		if(antibacterialDrugRecord.antibacterialDrugRegimenCode){
			var selectOption = add_content.find("select[name$='antibacterialDrugRegimenCode']").find("option[value='"+antibacterialDrugRecord.antibacterialDrugRegimenCode+"']")
			if(selectOption.length > 0){
				selectOption.attr("selected",true);
			}else{
				add_content.find("select[name$='antibacterialDrugRegimenCode']").append("<option selected='selected' value='"+antibacterialDrugRecord.antibacterialDrugRegimenCode+"'>"+infectionRecord.antibacterialDrugRegimenName+"</option>");
			}
			
		};
		add_content.find("input[name$='.antibacterialDrugRegimenName']").val(antibacterialDrugRecord.antibacterialDrugRegimenName);
		
		if(antibacterialDrugRecord.pathogenCode){
			var selectOption = add_content.find("select[name$='pathogenCode']").find("option[value='"+antibacterialDrugRecord.pathogenCode+"']")
			if(selectOption.length > 0){
				selectOption.attr("selected",true);
			}else{
				add_content.find("select[name$='pathogenCode']").append("<option selected='selected' value='"+antibacterialDrugRecord.pathogenCode+"'>"+infectionRecord.pathogenName+"</option>");
			}
			
		};
		add_content.find("input[name$='.pathogenName']").val(antibacterialDrugRecord.pathogenName);
		
		
		if(antibacterialDrugRecord.antibacterialDrugClassificatoryCode){
			var selectOption = add_content.find("select[name$='antibacterialDrugClassificatoryCode']").find("option[value='"+antibacterialDrugRecord.antibacterialDrugClassificatoryCode+"']")
			if(selectOption.length > 0){
				selectOption.attr("selected",true);
			}else{
				add_content.find("select[name$='antibacterialDrugClassificatoryCode']").append("<option selected='selected' value='"+antibacterialDrugRecord.antibacterialDrugClassificatoryCode+"'>"+infectionRecord.antibacterialDrugClassificatoryName+"</option>");
			}
			
		};
		add_content.find("input[name$='.antibacterialDrugClassificatoryName']").val(antibacterialDrugRecord.antibacterialDrugClassificatoryName);
		
		
		if(antibacterialDrugRecord.pathogenyCheckSpecimenCode){
			var selectOption = add_content.find("select[name$='pathogenyCheckSpecimenCode']").find("option[value='"+antibacterialDrugRecord.pathogenyCheckSpecimenCode+"']")
			if(selectOption.length > 0){
				selectOption.attr("selected",true);
			}else{
				add_content.find("select[name$='pathogenyCheckSpecimenCode']").append("<option selected='selected' value='"+antibacterialDrugRecord.pathogenyCheckSpecimenCode+"'>"+infectionRecord.pathogenyCheckSpecimenName+"</option>");
			}
			
		};
		add_content.find("input[name$='.pathogenyCheckSpecimenName']").val(antibacterialDrugRecord.pathogenyCheckSpecimenName);
		
	} 
	
	
	
	if($("#antibacterial_drug_ul li").length <1){
		addAntibacterialDrugRecord();
	}else{
		$("#antibacterial_drug_ul li").first().click();
	}
}

function addAntibacterialDrugRecord(){
	var basePath = $("#basePath").val();
	var antibacterialDrugCountOjb = $("#antibacterialDrugRecordCount");
	var count = parseInt(antibacterialDrugCountOjb.val());
	
	var addli=$("#template_antibacterial_drug_ul li:eq(0)").clone();
    addli.text("记录"+(count+1));
    addli.attr("data-index",count);
    $("#antibacterial_drug_ul").append(addli);
    addli.addClass("selected").siblings().removeClass("selected");
    addli.click(function(){
    	$(this).addClass("selected").siblings().removeClass("selected");
        $("#antibacterialDrugRecord"+$(this).attr("data-index")).show().siblings().hide();
    });
    var add_content=$("#templateAntibacterialDrugRecord").clone();
	add_content.attr("id","antibacterialDrugRecord"+count);
	
	add_content.find("input[name^='antibacterialDrugRecords[0].']").each(function(){
		var eventObj = $(this);
		eventObj.attr("name",eventObj.attr("name").replace("antibacterialDrugRecords[0]", "antibacterialDrugRecords["+count+"]"));
   		
	});
	
	add_content.find("select[name^='antibacterialDrugRecords[0].']").each(function(){
		var eventObj = $(this);
		eventObj.attr("name",eventObj.attr("name").replace("antibacterialDrugRecords[0]", "antibacterialDrugRecords["+count+"]"));
	});
	
	add_content.find("select[data-select='selectCodeAndName']").each(function(){
		$(this).change(function(){
	   		var eventObj = $(this);
	   		var nameObjName = eventObj.attr("name").replace("Code", "Name");
	   		
	   		if(eventObj.val()!=""){
	   			var name=eventObj.find("option:selected").text();
	   			eventObj.next("input[name='"+nameObjName+"']").val(name);
	   		}else{
	   			eventObj.next("input[name='"+nameObjName+"']").val("");
	   		}
	   	});
	});
	
	add_content.find("input[data-radio='radioCodeAndName']").each(function(){
		 $(this).click(function(){
			 var radioName = "";
			 if($(this).val()=="1"){
				 radioName = "是";
			 }else if($(this).val()=="0"){
				 radioName = "否";
			 }
			 $(this).nextAll("input[name='"+$(this).attr("name").replace("Code", "Name")+"']").val(radioName);
		 });
	});
	
	$("#antibacterialDrugRecords").append(add_content);
	add_content.show().siblings().hide();
	antibacterialDrugCountOjb.val(count +1);
	return add_content;
}

function deleteAntibacterialDrug(){
	var delete_option = $("#antibacterial_drug_ul li[class='selected']");
	var delete_index = delete_option.attr("data-index");
	delete_option.remove();
	
    $("#antibacterial_drug_ul li:last").addClass("selected").siblings().removeClass("selected");
    /*内容删除最后一项*/
    $("#antibacterialDrugRecord"+delete_index).remove();
    $("#antibacterialDrugRecords div:last").show().siblings().hide();
}